<%@ page import="java.util.Date" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="../include/tag.jsp" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>众筹结束跟进</title>
    <%@include file="../include/commonFile.jsp" %>
    <link rel="stylesheet" href="${ctx}/css/common/list.css">
    <link rel="stylesheet" href="${ctx}/css/common/table.css">
</head>
<body>
<!--头部-->
<%@include file="../include/header.jsp" %>
<div class="index-outside">
    <%@include file="../include/sidebar.jsp" %>
    <!--内容-->
    <section>
        <div class="section-main">
            <form class="layui-form" action="${ctx}/crowdfund/followUp/list.do" id="myForm" method="post">
                <input type="hidden" name="pageNo" id="pageNo"/>
                <div class="f-search-bar">
                    <div class="search-container">
                        <ul class="search-form-content">
                            <li class="form-item-inline"><label class="search-form-lable">主题名称</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="name" autocomplete="off" class="layui-input" value="${event.name}" placeholder="请输入主题名称">
                                </div>
                            </li>
                            <li class="form-item-inline"><label class="search-form-lable">众筹结束时间</label>
                                <div class="layui-inline">
                                    <div class="layui-input-inline">
                                        <input class="layui-input" type="text" name="createStart"
                                               value="${input.createStart}" placeholder="开始日">
                                    </div>
                                    -
                                    <div class="layui-input-inline">
                                        <input class="layui-input" type="text" name="createEnd"
                                               value="${input.createEnd}" placeholder="截止日">
                                    </div>
                                </div>
                            </li>
                            <li class="form-item-inline">
                                <div class="sub-btns">
                                    <a class="layui-btn layui-btn-danger"
                                       href="javascript:submitFunction('#myForm')">查询</a>
                                    <a class="layui-btn layui-btn-normal"
                                       href="javascript:resetFunction('#myForm')">重置</a>
                                </div>
                            </li>
                        </ul>

                    </div>
                </div>
            </form>
            <div class="my-act-list-content">
                <ul class="num">
                    <div class="l">
                        <li class="f16">共<span class="red">${page.totalCount}</span>数据</li>
                    </div>
                    <div class="r">
                        <li style="cursor: pointer;" class="r">

                                <a class="layui-btn layui-btn-danger layui-btn-sm"
                                   href="javascript:txz.expireCheck('', function() { exportExcelData() })">导出EXCEL</a>
                        </li>
                    </div>
                    <p class="cl"></p>
                </ul>
                <div class="cl">
                    <table class="layui-table">
                        <colgroup>
                            <col width="75px">
                            <col>
                            <col>
                            <col width="120px">
                            <col width="120px">
                            <col width="80px">
                            <col width="80px">
                            <col width="80px">
                            <col width="80px">
                            <col width="80px">
                            <col width="80px">
                            <col width="80px">
                            <col width="80px">
                            <col width="80px">
                            <col width="70px">
                        </colgroup>
                        <thead>
                        <tr>
                            <th>排列号</th>
                            <th>主题名称</th>
                            <th>发布者</th>
                            <th>发布时间</th>
                            <th>众筹结束时间</th>
                            <th>众筹结束时长/天</th>
                            <th>已退款人数</th>
                            <th>未退款人数</th>
                            <th>资金保留人数</th>
                            <th>未确认转移人数</th>
                            <th>已确认转移人数</th>
                            <th>成功人数</th>
                            <th>成功金额</th>
                            <th>剩余金额</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach var="event" items="${list}" varStatus="st">
                            <c:set var="nowDate" value="<%=new Date()%>"></c:set>
                            <tr>
                                <td>
                                    <c:set var="rowNo" value="${st.count + ((page.page - 1) * page.limit)}"/>
                                    <c:if test="${rowNo < 10}">0${rowNo}</c:if>
                                    <c:if test="${rowNo >= 10}">${rowNo}</c:if>
                                </td>
                                <td class="">
                                    <div class="ellipsis-1" title="${event.NAME}">${event.NAME}</div>
                                </td>
                                <td class="table-member"
                                    onclick="openDialogShow('用户名片','${ctx}/system/member/memberView.do?id=${event.createBy}','400px','470px')">
                                    <div class="member-cell">
                                        <div class="member-logo common-img">
                                            <img src="<c:if test="${event.logo != null}">${event.logo}?imageMogr2/auto-orient/crop/126x126</c:if>" alt="" onerror="txz.errImg(this)" onload="txz.imgLoad(this)">
                                        </div>
                                        <div class="member-name ellipsis-1">
                                            <a class="blue" title="${event.realname}" href="javascript:void(0);">${event.realname}</a>
                                        </div>
                                    </div>
                                </td>
                                <td><fmt:formatDate value="${event.createDate}" pattern="yyyy-MM-dd HH:mm"/></td>
                                <td><fmt:formatDate value="${event.endTime}" pattern="yyyy-MM-dd HH:mm"/></td>
                                <td>
                                   ${event.format}
                                </td>
                                <td>
                                    ${event.refundNumber}
                                </td>
                                <td>
                                    ${event.notRefundNumber}
                                </td>
                                <td>
                                    ${event.totalFunds}
                                </td>
                                <td>
                                   ${event.notNumberTransfers}
                                </td>
                                <td>
                                    ${event.numberTransfers}
                                </td>
                                <td>
                                        ${event.successNum}
                                </td>
                                <td>
                                    <c:if test="${event.successMoney > 0}">
                                        <fmt:formatNumber pattern="#,###.##" value="${event.successMoney}"/>
                                    </c:if>
                                    <c:if test="${event.successMoney == 0.0}">
                                        ${event.successMoney}
                                    </c:if>
                                </td>
                                <td>
                                    <c:if test="${event.remainMoney > 0}">
                                        <fmt:formatNumber pattern="#,###.##" value="${event.remainMoney}"/>
                                    </c:if>
                                    <c:if test="${event.remainMoney == 0.0}">
                                        ${event.remainMoney}
                                    </c:if>
                                </td>
                                <td class="tb-opts">
                                    <div class="comm-opts">
                                            <a href="${ctx}/crowdfund/followUp/listForEvent.do?eventId=${event.eventId}"
                                               target="_self">查看</a>
                                    </div>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>

                    </table>
                </div>
            </div>
            <div id="page_content" class="page-container"></div>
        </div><!--底部-->
        <%@include file="../include/footer.jsp" %>
    </section>
    <div id="copartnerList" style="padding: 0px 10px"></div>
</div>

<script type="text/javascript" src="${ctx}/script/common/list.js"></script>
<script type="text/javascript" src="${ctx}/script/common/table_option.js"></script>
<script type="text/javascript">
    txz.initHeader({
        nav:[{
            name: '众筹结束跟进',
            curr: true
        }],
        info:'<span class="f12">共<b>${page.totalCount}</b>条记录'
    });
    $(function () {
        //加载分页
        loadPageNew({elem: 'page_content', totalCount: '${page.totalCount}', limit: '${page.limit}', page: '${page.page}'});
        layui.use(['laydate'], function () {
            var laydate = layui.laydate;
            // 查询发布日期
            var start = {
                elem: 'input[name=createStart]'
            };

            var end = {
                elem: 'input[name=createEnd]'
            };
            laydate.render(start);
            laydate.render(end);
        });
    });

    function exportExcelData() {
        layer.confirm('确认要导出Excel吗?', {
            icon: 3,
            title: '系统提示'
        }, function (index) {
            var url = "${ctx}/crowdfund/followUp/endListExport.do";
            var loadIndex = layer.load(1, {
                shade: [0.1,'#fff'] //0.1透明度的白色背景
            });
            $.post(url, $("#myForm").serialize(), function (res) {
                top.layer.close(loadIndex);
                if (res.success) {
                    window.location.href = res.data;
                } else {
                    util.layerMsgError(res.description)
                }
            });
            top.layer.close(index);
        });
    }
</script>
</body>
</html>